//
//  STCollectionViewCell.swift
//  iPhone
//
//  Created by Toj on 7/11/23.
//

import UIKit

class STCollectionViewCell: UICollectionViewCell {
    var numberString = "" { didSet {
        numberLabel.text = numberString
    } }
  
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        setupMakeAddSubviews()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
        setupMakeLayoutSubviews()
    }
    
    private lazy var numberLabel: UILabel = {
        let view = UILabel()
        view.textColor = UIColor(hex: "#AAAAAA")
        view.font = UIFont.systemFont(ofSize: 14)
        view.textAlignment = .left
        return view
    }()
}

// MARK: - 初始化
extension STCollectionViewCell {
    
    private func setupMakeAddSubviews() {
        
        contentView.addSubview(numberLabel)
    }
    
    private func setupMakeLayoutSubviews() {
        numberLabel.snp.makeConstraints { make in
            make.centerY.equalTo(contentView)
            make.left.right.equalTo(contentView).inset(20)
        }
    }
}
